<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MTB CAT1 Peripheral driver library: Functions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="IFXCYP_one-line.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">MTB CAT1 Peripheral driver library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__group__ephy__functions.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Functions<div class="ingroups"><a class="el" href="group__group__ephy.html">EPHY         (Ethernet PHY)</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gab1637c80ec3ae7b2c4e6584dca117567"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__ephy__enums.html#ga3790bdc971ee68851d956d57aa72eb82">cy_en_ephy_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ephy__functions.html#gab1637c80ec3ae7b2c4e6584dca117567">Cy_EPHY_Init</a> (<a class="el" href="structcy__stc__ephy__t.html">cy_stc_ephy_t</a> *phy, <a class="el" href="group__group__ephy__data__structures.html#ga9026ac03446eb19032e3d3eaf4cc10a5">cy_ephy_read_handle</a> fnRead, <a class="el" href="group__group__ephy__data__structures.html#gae065ec9f5d7028762e4e8fa9660840e5">cy_ephy_write_handle</a> fnWrite)</td></tr>
<tr class="memdesc:gab1637c80ec3ae7b2c4e6584dca117567"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function initializes the private structure and assign a PHY-read, PHY-write function handle to its private data structure.  <a href="#gab1637c80ec3ae7b2c4e6584dca117567">More...</a><br /></td></tr>
<tr class="separator:gab1637c80ec3ae7b2c4e6584dca117567"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1e7c065567753697643e27d823b12415"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__ephy__enums.html#ga3790bdc971ee68851d956d57aa72eb82">cy_en_ephy_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ephy__functions.html#ga1e7c065567753697643e27d823b12415">Cy_EPHY_Discover</a> (<a class="el" href="structcy__stc__ephy__t.html">cy_stc_ephy_t</a> *phy)</td></tr>
<tr class="memdesc:ga1e7c065567753697643e27d823b12415"><td class="mdescLeft">&#160;</td><td class="mdescRight">Discovers connected PHY at address zero.  <a href="#ga1e7c065567753697643e27d823b12415">More...</a><br /></td></tr>
<tr class="separator:ga1e7c065567753697643e27d823b12415"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4a2dcc3c1d82a0f1cbc2b699529a96f2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__ephy__enums.html#ga3790bdc971ee68851d956d57aa72eb82">cy_en_ephy_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ephy__functions.html#ga4a2dcc3c1d82a0f1cbc2b699529a96f2">Cy_EPHY_Configure</a> (<a class="el" href="structcy__stc__ephy__t.html">cy_stc_ephy_t</a> *phy, <a class="el" href="structcy__stc__ephy__config__t.html">cy_stc_ephy_config_t</a> *config)</td></tr>
<tr class="memdesc:ga4a2dcc3c1d82a0f1cbc2b699529a96f2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Configures PHY with user provided speed and duplex mode.  <a href="#ga4a2dcc3c1d82a0f1cbc2b699529a96f2">More...</a><br /></td></tr>
<tr class="separator:ga4a2dcc3c1d82a0f1cbc2b699529a96f2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab9877b438dc122749cd79a073be982a3"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ephy__functions.html#gab9877b438dc122749cd79a073be982a3">Cy_EPHY_GetLinkStatus</a> (<a class="el" href="structcy__stc__ephy__t.html">cy_stc_ephy_t</a> *phy)</td></tr>
<tr class="memdesc:gab9877b438dc122749cd79a073be982a3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get current link status of PHY.  <a href="#gab9877b438dc122749cd79a073be982a3">More...</a><br /></td></tr>
<tr class="separator:gab9877b438dc122749cd79a073be982a3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4755f9c6f13d195c3cc598217904bdaf"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__ephy__enums.html#ga3790bdc971ee68851d956d57aa72eb82">cy_en_ephy_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ephy__functions.html#ga4755f9c6f13d195c3cc598217904bdaf">Cy_EPHY_Reset</a> (<a class="el" href="structcy__stc__ephy__t.html">cy_stc_ephy_t</a> *phy)</td></tr>
<tr class="memdesc:ga4755f9c6f13d195c3cc598217904bdaf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Soft reset PHY by enabling 15th bit of BMCR register.  <a href="#ga4755f9c6f13d195c3cc598217904bdaf">More...</a><br /></td></tr>
<tr class="separator:ga4755f9c6f13d195c3cc598217904bdaf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gabcd447e67ac01d797abecadebd82b3d2"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ephy__functions.html#gabcd447e67ac01d797abecadebd82b3d2">Cy_EPHY_GetAutoNegotiationStatus</a> (<a class="el" href="structcy__stc__ephy__t.html">cy_stc_ephy_t</a> *phy)</td></tr>
<tr class="memdesc:gabcd447e67ac01d797abecadebd82b3d2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get current Auto-Negotiation status (completed or In-progress).  <a href="#gabcd447e67ac01d797abecadebd82b3d2">More...</a><br /></td></tr>
<tr class="separator:gabcd447e67ac01d797abecadebd82b3d2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaadfc8591e97eb0c9e11199ba2b1da39a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__ephy__enums.html#ga3790bdc971ee68851d956d57aa72eb82">cy_en_ephy_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ephy__functions.html#gaadfc8591e97eb0c9e11199ba2b1da39a">Cy_EPHY_getLinkPartnerCapabilities</a> (<a class="el" href="structcy__stc__ephy__t.html">cy_stc_ephy_t</a> *phy, <a class="el" href="structcy__stc__ephy__config__t.html">cy_stc_ephy_config_t</a> *lpConfig)</td></tr>
<tr class="memdesc:gaadfc8591e97eb0c9e11199ba2b1da39a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets Link partner capabilities (speed and duplex)  <a href="#gaadfc8591e97eb0c9e11199ba2b1da39a">More...</a><br /></td></tr>
<tr class="separator:gaadfc8591e97eb0c9e11199ba2b1da39a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="gab1637c80ec3ae7b2c4e6584dca117567"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab1637c80ec3ae7b2c4e6584dca117567">&#9670;&nbsp;</a></span>Cy_EPHY_Init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__ephy__enums.html#ga3790bdc971ee68851d956d57aa72eb82">cy_en_ephy_status_t</a> Cy_EPHY_Init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcy__stc__ephy__t.html">cy_stc_ephy_t</a> *&#160;</td>
          <td class="paramname"><em>phy</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__ephy__data__structures.html#ga9026ac03446eb19032e3d3eaf4cc10a5">cy_ephy_read_handle</a>&#160;</td>
          <td class="paramname"><em>fnRead</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__ephy__data__structures.html#gae065ec9f5d7028762e4e8fa9660840e5">cy_ephy_write_handle</a>&#160;</td>
          <td class="paramname"><em>fnWrite</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function initializes the private structure and assign a PHY-read, PHY-write function handle to its private data structure. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">phy</td><td>pointer to PHY private data structure. </td></tr>
    <tr><td class="paramname">fnRead</td><td>pointer to read function implemented in application </td></tr>
    <tr><td class="paramname">fnWrite</td><td>pointer to write function implemented in application</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Initialization status </dd>
<dd>
CY_EPHY_SUCCESS for successfully initializes the internal data structures. </dd></dl>

</div>
</div>
<a id="ga1e7c065567753697643e27d823b12415"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga1e7c065567753697643e27d823b12415">&#9670;&nbsp;</a></span>Cy_EPHY_Discover()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__ephy__enums.html#ga3790bdc971ee68851d956d57aa72eb82">cy_en_ephy_status_t</a> Cy_EPHY_Discover </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcy__stc__ephy__t.html">cy_stc_ephy_t</a> *&#160;</td>
          <td class="paramname"><em>phy</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Discovers connected PHY at address zero. </p>
<p>Reads ID1 and ID2 register to form PHY ID.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">phy</td><td>pointer to PHY private data structure</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>CY_EPHY_ERROR PHY chip contains invalid PHY ID </dd>
<dd>
CY_EPHY_SUCCESS PHY chip contains a valid PHY ID </dd></dl>

</div>
</div>
<a id="ga4a2dcc3c1d82a0f1cbc2b699529a96f2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4a2dcc3c1d82a0f1cbc2b699529a96f2">&#9670;&nbsp;</a></span>Cy_EPHY_Configure()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__ephy__enums.html#ga3790bdc971ee68851d956d57aa72eb82">cy_en_ephy_status_t</a> Cy_EPHY_Configure </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcy__stc__ephy__t.html">cy_stc_ephy_t</a> *&#160;</td>
          <td class="paramname"><em>phy</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__stc__ephy__config__t.html">cy_stc_ephy_config_t</a> *&#160;</td>
          <td class="paramname"><em>config</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Configures PHY with user provided speed and duplex mode. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">phy</td><td>pointer to PHY private data structure </td></tr>
    <tr><td class="paramname">config</td><td>pointer to PHY configuration structure</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>CY_EPHY_SUCCESS Successfully configure PHY registers </dd>
<dd>
CY_EPHY_AN_NOT_SUPPORTED PHY does not support Auto-Negotiation.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>For Auto-Negotiation configure the speed and duplex mode to CY_EPHY_SPEED_AUTO and CY_EPHY_DUPLEX_AUTO respectively. In this configuration PHY will advertise with highest capabilities. Also if vendor specific registers are supported then user may needs to configure the vendor specific registers to highest capabilities. For more details please refer to the PHY datasheet. </dd></dl>

</div>
</div>
<a id="gab9877b438dc122749cd79a073be982a3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab9877b438dc122749cd79a073be982a3">&#9670;&nbsp;</a></span>Cy_EPHY_GetLinkStatus()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t Cy_EPHY_GetLinkStatus </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcy__stc__ephy__t.html">cy_stc_ephy_t</a> *&#160;</td>
          <td class="paramname"><em>phy</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get current link status of PHY. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">phy</td><td>pointer to PHY private data structure</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>link status of PHY (0=down, 1=up) </dd></dl>

</div>
</div>
<a id="ga4755f9c6f13d195c3cc598217904bdaf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4755f9c6f13d195c3cc598217904bdaf">&#9670;&nbsp;</a></span>Cy_EPHY_Reset()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__ephy__enums.html#ga3790bdc971ee68851d956d57aa72eb82">cy_en_ephy_status_t</a> Cy_EPHY_Reset </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcy__stc__ephy__t.html">cy_stc_ephy_t</a> *&#160;</td>
          <td class="paramname"><em>phy</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Soft reset PHY by enabling 15th bit of BMCR register. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">phy</td><td>pointer to PHY private data structure</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>CY_EPHY_SUCCESS for successful soft reset </dd></dl>

</div>
</div>
<a id="gabcd447e67ac01d797abecadebd82b3d2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gabcd447e67ac01d797abecadebd82b3d2">&#9670;&nbsp;</a></span>Cy_EPHY_GetAutoNegotiationStatus()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t Cy_EPHY_GetAutoNegotiationStatus </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcy__stc__ephy__t.html">cy_stc_ephy_t</a> *&#160;</td>
          <td class="paramname"><em>phy</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get current Auto-Negotiation status (completed or In-progress). </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">phy</td><td>pointer to PHY private data structure</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Auto-Negotiation status of PHY. 0 = Auto-Negotiation process is not completed. 1 = Auto-Negotiation process is completed. </dd></dl>

</div>
</div>
<a id="gaadfc8591e97eb0c9e11199ba2b1da39a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaadfc8591e97eb0c9e11199ba2b1da39a">&#9670;&nbsp;</a></span>Cy_EPHY_getLinkPartnerCapabilities()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__ephy__enums.html#ga3790bdc971ee68851d956d57aa72eb82">cy_en_ephy_status_t</a> Cy_EPHY_getLinkPartnerCapabilities </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcy__stc__ephy__t.html">cy_stc_ephy_t</a> *&#160;</td>
          <td class="paramname"><em>phy</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcy__stc__ephy__config__t.html">cy_stc_ephy_config_t</a> *&#160;</td>
          <td class="paramname"><em>lpConfig</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Gets Link partner capabilities (speed and duplex) </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">phy</td><td>Pointer to PHY private data structure </td></tr>
    <tr><td class="paramname">lpConfig</td><td>[Output] Speed and duplex information</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>CY_EPHY_SUCCESS : Success in processing the link capability. </dd>
<dd>
CY_EPHY_ERROR : Error in processing the link capability. Ignore the lpConfig output parameter. </dd></dl>
<dl class="section note"><dt>Note</dt><dd>This function should be called after Auto-Negotiation is completed ( <a class="el" href="group__group__ephy__functions.html#gabcd447e67ac01d797abecadebd82b3d2">Cy_EPHY_GetAutoNegotiationStatus</a> ) </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>MTB CAT1 Peripheral driver library</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
-->
</body>
</html>
